//
//  Prefs.m
//  WorkBreak
//
//  Created by Wei Nan Li on 5/8/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "Prefs.h"


@implementation Prefs

- (id)init{	
	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
	NSDictionary* appDefaults	= [NSDictionary dictionaryWithObjectsAndKeys:
								   @"50.0f",workIntervalKey,
								   @"10.0f",restIntervalKey,
								   nil
								   ];
	
	[defaults registerDefaults:appDefaults];
	
	workInterval = [defaults floatForKey:workIntervalKey];
	restInterval = [defaults floatForKey:restIntervalKey];
	
	return self;
}


- (float)	workInterval{
	return workInterval;
}

- (float)	restInterval{
	return restInterval;
}

- (float) defaultWorkInterval {
	return [[NSUserDefaults standardUserDefaults] floatForKey:workIntervalKey];
}

- (float) defaultRestInterval {
	return [[NSUserDefaults standardUserDefaults] floatForKey:restIntervalKey];
	
}

@end
